<?php

class Core{

	private $param = array();
	public $config = NULL;

	public function __construct($param){
		if (!is_null($param))
			$this->param = explode(' ', strtolower(trim($param)));

		if (!in_array('noconfig', $this->param))
			self::loadConfig();

		if (!in_array('nodb', $this->param))
			self::loadDatabase();


	}

	public function loadDatabase(){
		import('Database.Dal.~');
		$db = Hoa_Database_Dal::getInstance(
			'myConn',
			Hoa_Database_Dal::PDO,
			'mysql:host='.$this->config->config->db->dbhost.';dbname='.$this->config->db->dbname.'',
			''.$this->config->db->dbuser.'',
			''.$this->config->db->dbpassword.''
		);
	}

	public function checkMaster(){
		return false;
	}

	public function loadConfig(){
		import('Controller.Front');
		import('Configuration.Array');
		echo 'aaa';
		$this->config = new Hoa_Configuration_Array(require 'config.php');
		$controller->attachObject('config', $config);
	}


}

?>